﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.models {
    import flash.system.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;
    import net.wooga.pets.utils.*;

    public class EnvironmentModel extends Actor {

        private var _facebookUrl:String;
        private var _service_url:String;
        private var _locale:String = "en_US"
        private var _localVersion:Boolean = true
        private var _tracking_url:String;
        private var _revision:String;
        private var _environment:String;
        private var _config:Object;

        public function EnvironmentModel(){
            this._config = {};
            super();
        }
        public function get main_service_url():String{
            return (this._service_url);
        }
        public function set main_service_url(_arg1:String):void{
            this._service_url = _arg1;
        }
        public function get locale():String{
            return (this._locale);
        }
        public function set locale(_arg1:String):void{
            this._locale = _arg1.toLocaleLowerCase();
        }
        public function get facebookUrl():String{
            return (this._facebookUrl);
        }
        public function set facebookUrl(_arg1:String):void{
            this._facebookUrl = _arg1;
        }
        public function get localVersion():Boolean{
            return (this._localVersion);
        }
        public function set localVersion(_arg1:Boolean):void{
            this._localVersion = _arg1;
        }
        public function get liveVersion():Boolean{
            var _local1:Boolean;
            _local1 = ((_local1) && ((this.main_service_url.indexOf("ci") == -1)));
            _local1 = ((_local1) && ((this.main_service_url.indexOf("staging") == -1)));
            return (_local1);
        }
        public function get tracking_url():String{
            return (this._tracking_url);
        }
        public function set tracking_url(_arg1:String):void{
            this._tracking_url = _arg1;
        }
        public function get revision():String{
            return (this._revision);
        }
        public function set revision(_arg1:String):void{
            this._revision = _arg1;
        }
        public function get language():String{
            return (this.locale.split("_")[0]);
        }
        public function get country():String{
            return (this.locale.split("_")[1]);
        }
        public function get environment():String{
            return (this._environment);
        }
        public function set environment(_arg1:String):void{
            this._environment = _arg1;
        }
        public function get config():Object{
            return (this._config);
        }
        public function set config(_arg1:Object):void{
            this._config = _arg1;
        }
        public function isMacOS():Boolean{
            var _local1:String = Capabilities.os;
            log(_local1);
            return (!((_local1.indexOf("Mac") == -1)));
        }
        public function getConfig(_arg1:String){
            return (Objects.getValue(this._config, _arg1));
        }
        public function setConfig(_arg1:String, _arg2):void{
            Objects.setValue(this._config, _arg1, _arg2);
        }

        public static function getSupportedLocale(_arg1:String, _arg2:String=null):String{
            var _local3:Array = String(((_arg2) || (GameConstants.DEFAULT_LOCALE))).split(",");
            var _local4:String = _arg1.toLowerCase().split("_")[0];
            var _local5:String = ((_local3.indexOf(_local4))!=-1) ? _arg1 : GameConstants.DEFAULT_LOCALE;
            return (_local5);
        }

    }
}//package net.wooga.pets.models 
